﻿using Silvermoon.UI;
using System.Drawing;
using Silvermoon.Windows;

namespace Silvermoon.Controls
{
    public static class TextboxStateManagers
    {
        public static readonly VisualStateManager BaseManager = new VisualStateManager(
         new VisualStateGroup(
             new VisualState(VState.Normal, 50),
             new VisualState(VState.Pressed,
                 new ScaleTransition { Duration = 5, To = new ScaleTransform(0.95f, 0.95f, 1f) },
                 new IntTransition { Property = ChromeControl.ChromeOpacityProperty, Duration = 5, To = 255 },
                  new ColorTransition { Duration = 5, To = PhoneColors.White }
             )
        ),
         new VisualStateGroup(
             new VisualState(VState.Focused, new ColorTransition { Duration = 5, To = PhoneColors.White }, new IntTransition { Property = ChromeControl.ChromeOpacityProperty, Duration = 300, To = 255 }),
             new VisualState(VState.Unfocused, new IntTransition { Property = ChromeControl.ChromeOpacityProperty, Duration = 300, To = 0 })
        )

         , new VisualStateGroup(
             new VisualState(VState.Enabled, new IntTransition { Duration = 300, To = 255, Property = ChromeControl.BackgroundOpacityProperty }),
             new VisualState(VState.Disabled,
                 new ColorTransition { Duration = 1, To = PhoneColors.White, Property = ChromeControl.ChromeColorProperty },
                 new ColorTransition { Duration = 5, To = PhoneColors.Text, Property = Control.TextColorProperty },
                 new IntTransition { Duration = 5, Property = ChromeControl.ChromeOpacityProperty, To = 255 },
                 new IntTransition { Duration = 300, To = 0, Property = ChromeControl.BackgroundOpacityProperty })
             )
        );

    }
}
